-- 地上地下入口出口通信
AddShardModRPCHandler("SHADOWWOVEN", "Cordon", function(linkedWorld, id, cordon)
    for i, v in ipairs(ShardPortals) do
        if v.components.worldmigrator.id == id and v.components.sw_cordon ~= nil then
            v.components.sw_cordon.cordon = cordon
            TheWorld.components.sw_sealsinkholemanager:RefreshUnbalanceState()
        end
    end
end)

-- 获取物品信息RPC
AddModRPCHandler("SHADOWWOVEN", "Showinfo", function(player, guid, item)
    if player.player_classified == nil or player.player_classified.net_sw_info == nil then
        return
    end
    if item ~= nil and item.components ~= nil then
        local str = ""
        -- 显示本mod特殊信息
        if item.getSwInfo then
            local sw_info = item:getSwInfo()
            if sw_info then
                str = str .. "\n" .. sw_info
            end
        end
        if str and str ~= "" then
            player.player_classified.net_sw_info:set(guid .. ";" .. str)
        else
            player.player_classified.net_sw_info:set("")
        end
    end
end)
